/* 
 * File:   JStubArgument.cpp
 * Author: johnneyshi
 * 
 * Created on 2013年5月14日, 下午8:31
 */

#include "JStubArgument.h"
#include "JWorkingCopies.h"
#include "JWorkingCopiesBaseFile.h"
#include "JFile.h"
#include "JDir.h"
#include "JString.h"
#include "JInOutPut.h"
#include <string>

JStubArgument::JStubArgument() 
{
}


JStubArgument::~JStubArgument() 
{
}

JStubArgument* JStubArgument::StubArgumentFactory(JInOutPut& _strea,std::string _arg)
{
    if(_arg == "JWorkingCopies&")
    {
        JWorkingCopies* pWorkingCopies = new JWorkingCopies();
        pWorkingCopies->UnPackStubMessage(_strea);
        return pWorkingCopies;
    }
    else if(_arg == "JWorkingCopiesBaseFile&")
    {
        JWorkingCopiesBaseFile* pWorkingCopiesBaseFile = new JWorkingCopiesBaseFile();
        pWorkingCopiesBaseFile->UnPackStubMessage(_strea);
        return pWorkingCopiesBaseFile;
    }
    else if(_arg == "JFile&")
    {
        JFile* pFile = new JFile();
        pFile->UnPackStubMessage(_strea);
        return pFile;
    }
    else if(_arg == "JDir&")
    {
        JDir* pDir = new JDir();
        pDir->UnPackStubMessage(_strea);
        return pDir;
    }
    else if(_arg == "JString&")
    {
        JString* pStr = new JString();
        pStr->UnPackStubMessage(_strea);
        return pStr;
    }
    return NULL;
}